package com.client.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Random;

import com.manage.cache.OrderConfigManager;
import com.manage.model.OrderConfig;
import com.util.Loggable;

public class SdkIPayOrder  extends Loggable implements Serializable{
	
	private static final long serialVersionUID = 1L;
	
	private int id;
	private String orderId;
	private String suborderId;
	private int userId;
	private String mobileNo;
	private String carrier;
	private String province;
	private String region;
	private String feeValue;
	private int channelId;
	private int projectId;
	private int report;
	private Date orderTime;
	private Date reportTime;
	private int errorNum;
	
	private String orderTime1;
	private String reportTime1;
	
	private int cpid;
	private String appid;
	private String goodscode;
	private String goodsname;
	private String chid;    //cp自动自定义渠道
	private String requestfee;//请求金额
	private String successfee;
	private String imsi;
	
	private String sdkid;
	private String reportsdkid;
	private List<SdkPayOrderCode> codelist;
	private int isfilter;
	
	public SdkIPayOrder()
	{
		
	}
	public SdkIPayOrder(String orderId,String suborderId,int report, Date reportTime,String successfee,String provider)
	{
		this.orderId = orderId;
		this.suborderId=suborderId;
		this.report=report;
		this.reportTime=reportTime;
		//入库错误次数
		this.errorNum = 0;
		this.successfee = successfee;
		this.reportsdkid = provider;
	}
	public SdkIPayOrder(int userId,String mobileNo,String carrier,
					String province,String region
					,String feeValue,int channelId,int projectId, Date orderTime, Date reportTime,
					int cpid,String appid,String goodscode,String goodsname,String chid,String requestfee,
					String successfee,String imsi)
	{
		String uuid = java.util.UUID.randomUUID().toString().replace("-", "");
		this.id=-1;
		this.orderId = uuid;
		this.suborderId = uuid+"01";
		this.userId = userId;
		this.mobileNo = mobileNo;
		this.carrier = carrier;
		this.province = province;
		this.region = region;
		this.feeValue = feeValue;
		this.channelId = channelId;
		this.projectId = projectId;
		this.report = -1;
		this.orderTime = orderTime;
		this.reportTime = reportTime;
		//入库错误次数
		this.errorNum = 0;
		
		this.cpid = cpid;
		this.appid = appid;
		this.goodscode = goodscode;
		this.goodsname = goodsname;
		this.chid = chid;
		this.requestfee = requestfee;
		this.successfee = successfee;
		this.imsi=imsi;
		
		this.codelist = new ArrayList<SdkPayOrderCode>();
		this.sdkid="";
		this.reportsdkid="";
		//过滤系数，默认不过滤
		int filternum = 100;
		filternum = OrderConfigManager.getInstance().getOrderConfigValue(this.cpid, this.appid);
		Random   rand   =   new   Random();   
		int rnum = rand.nextInt(100);
		if(rnum<filternum)
		{
			this.isfilter = 0;
		}
		else
		{
			this.isfilter = 1;
		}
		
	}
	
	public int getIsfilter() {
		return isfilter;
	}
	public void setIsfilter(int isfilter) {
		this.isfilter = isfilter;
	}
	public String getSdkid() {
		return sdkid;
	}
	public void setSdkid(String sdkid) {
		this.sdkid = sdkid;
	}
	public String getReportsdkid() {
		return reportsdkid;
	}
	public void setReportsdkid(String reportsdkid) {
		this.reportsdkid = reportsdkid;
	}
	public List<SdkPayOrderCode> getCodelist() {
		return codelist;
	}
	public void setCodelist(List<SdkPayOrderCode> codelist) {
		this.codelist = codelist;
	}
	public String getImsi() {
		return imsi;
	}
	public void setImsi(String imsi) {
		this.imsi = imsi;
	}
	public String getSuccessfee() {
		return successfee;
	}
	public void setSuccessfee(String successfee) {
		this.successfee = successfee;
	}
	public String getRequestfee() {
		return requestfee;
	}
	public void setRequestfee(String requestfee) {
		this.requestfee = requestfee;
	}
	public int getCpid() {
		return cpid;
	}
	public void setCpid(int cpid) {
		this.cpid = cpid;
	}
	public String getAppid() {
		return appid;
	}
	public void setAppid(String appid) {
		this.appid = appid;
	}
	public String getGoodscode() {
		return goodscode;
	}
	public void setGoodscode(String goodscode) {
		this.goodscode = goodscode;
	}
	public String getGoodsname() {
		return goodsname;
	}
	public void setGoodsname(String goodsname) {
		this.goodsname = goodsname;
	}
	public String getChid() {
		return chid;
	}
	public void setChid(String chid) {
		this.chid = chid;
	}
	public String getOrderTime1() {
		return orderTime1;
	}
	public void setOrderTime1(String orderTime1) {
		this.orderTime1 = orderTime1;
	}
	public String getReportTime1() {
		return reportTime1;
	}
	public void setReportTime1(String reportTime1) {
		this.reportTime1 = reportTime1;
	}
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getOrderId() {
		return orderId;
	}
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}
	public String getSuborderId() {
		return suborderId;
	}
	public void setSuborderId(String suborderId) {
		this.suborderId = suborderId;
	}
	public int getUserId() {
		return userId;
	}
	public void setUserId(int userId) {
		this.userId = userId;
	}
	public String getCarrier() {
		return carrier;
	}
	public void setCarrier(String carrier) {
		this.carrier = carrier;
	}
	public String getProvince() {
		return province;
	}
	public void setProvince(String province) {
		this.province = province;
	}
	public String getRegion() {
		return region;
	}
	public void setRegion(String region) {
		this.region = region;
	}
	public int getChannelId() {
		return channelId;
	}
	public void setChannelId(int channelId) {
		this.channelId = channelId;
	}
	public int getProjectId() {
		return projectId;
	}
	public void setProjectId(int projectId) {
		this.projectId = projectId;
	}
	public int getReport() {
		return report;
	}
	public void setReport(int report) {
		this.report = report;
	}
	public Date getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}
	public Date getReportTime() {
		return reportTime;
	}
	public void setReportTime(Date reportTime) {
		this.reportTime = reportTime;
	}
	public String getFeeValue() {
		return feeValue;
	}
	public void setFeeValue(String feeValue) {
		this.feeValue = feeValue;
	}
	public String getMobileNo() {
		return mobileNo;
	}
	public void setMobileNo(String mobileNo) {
		this.mobileNo = mobileNo;
	}
	public int getErrorNum() {
		return errorNum;
	}
	public void setErrorNum(int errorNum) {
		this.errorNum = errorNum;
	}
	
	
}
